<template>
  <div class="home">
    <div class="header">
      <span style="margin: 0 10rem;">&#xe60b;</span>
      <span style="font-size:18rem">广东供液大学傻鸟校区302c</span>
      <span style="margin-left: 80rem;">&#xe96d;</span>
    </div>
    <div class="search">
      <span class="search-icon">&#xe752;</span>
      <input type="text" placeholder="金龙大酒店" class="search-input" />
    </div>
    <div class="swiper">
      <img src="https://markdown-1253389072.cos.ap-nanjing.myqcloud.com/202202191609589.png" />
    </div>
    <div class="banner">
      <div class="banner-item" v-for="item in imgList">
        <span class="banner-item-icon">
          <img :src="item.addr" />
        </span>
        <span class="banner-item-name">{{ item.name }}</span>
      </div>
    </div>
    <div style="border: 8rem solid rgb(241, 241, 241);"></div>
    <Suspense>
      <template #default>
        <ShopMall></ShopMall>
      </template>

      <template #fallback>
        <div>loading...</div>
      </template>
    </Suspense>
  </div>
</template>

<script setup>
import { reactive, defineAsyncComponent } from 'vue';
const ShopMall = defineAsyncComponent(() => import('./ShopMall.vue'))

const imgList = [
  { name: '超市便利', addr: '/src/assets/image/banner/1.png' },
  { name: '菜市场', addr: '/src/assets/image/banner/2.png' },
  { name: '水果店', addr: '/src/assets/image/banner/3.png' },
  { name: '鲜花绿植', addr: '/src/assets/image/banner/4.png' },
  { name: '药店健康', addr: '/src/assets/image/banner/5.png' },
  { name: '家居时尚', addr: '/src/assets/image/banner/6.png' },
  { name: '烘焙蛋糕', addr: '/src/assets/image/banner/7.png' },
  { name: '签到', addr: '/src/assets/image/banner/8.png' },
  { name: '大牌免运', addr: '/src/assets/image/banner/9.png' },
  { name: '红包套餐', addr: '/src/assets/image/banner/10.png' },
]
let arrList = reactive([1, 2, 3])
arrList = [2, 3, 4]



</script>
<style lang='scss' scoped>
.home {
  .header {
    height: 40rem;
    font-family: "iconfont";
    font-size: 20rem;
    line-height: 40rem;
  }
  .search {
    font-family: iconfont;
    height: 35rem;
    width: 90vw;
    margin: 0 auto;
    margin-top: 5rem;
    border-radius: 20rem;
    background-color: rgb(244, 244, 244);
    text-align: center;
    line-height: 35rem;
    &-icon {
      font-size: 20rem;
    }
    &-input {
      margin: 0 20rem 0 5rem;
      transform: translateY(-2rem);
      line-height: 30rem;
      height: 30rem;
      width: 70vw;
      border: 0;
      outline: none;
      background-color: rgb(244, 244, 244);
    }
  }

  .swiper {
    width: 90vw;
    margin: 10rem auto;
    height: 100rem;
    img {
      width: 90vw;
      height: 100rem;

      background-size: cover;
    }
  }

  .banner {
    height: 170rem;
    width: 90vw;
    margin: 10rem auto;
    display: flex;
    flex-wrap: wrap;
    &-item {
      height: 70rem;
      width: 50rem;
      margin: 5rem 8rem;
      display: flex;
      flex-direction: column;
      text-align: center;
      &-name {
        font-size: 11rem;
        margin-top: 3rem;
      }
      &-icon {
        width: 45rem;
        height: 45rem;
        border-radius: 50%;
        background-color: #eee;
        // text-align: center;
        margin-left: 2rem;
        img {
          width: 45rem;
          height: 45rem;
          border-radius: 50%;
        }
      }
    }
  }
}
</style>